// -*- mode: c++; coding: utf-8 -*-

/**
 *
 * ICE implementation of the FIPA Agent Management Specification.
 * See http://fipa.org/specs/fipa00023/SC00023K.html for a detailed description.
 **/

#include <PropertyService.ice>
#include <Ice/Identity.ice>
#include <Ice/BuiltinSequences.ice>

module FIPA {

  /**
   * Possibles agent's states: Initiated, Active, Suspended, Waiting, and Transit.
   **/
  enum AgentState {Initiated, Active, Suspended, Waiting, Transit};

  /**
   * Possibles performatives of a ACL message.
   **/
  enum ACLPerformative {Accept, Agree, Cancel, Cfp, Confirm, Disconfirm, Failure, Inform, InformIf, InformRef, NotUnderstood, Propagate, 
			Propose, Proxy, QueryIf, QueryRef, Refuse, RejectProposal, Request, RequestWhen, RequestWhenever, Subscribe};

  /**
   * Possibles actions with the DF.
   **/
  enum DFAction {Registration, Deregistration, Modification};

  interface Agent;

  sequence<Agent*> AgentSeq;

  struct Envelope {
    AgentSeq to;
    Agent* frm;
    string aclRepresentation;
    long date;
  };

  struct ACLPayload {
    ACLPerformative performative;
    string content;
    // See FIPA00007.
    string language;
    // See FIPA00007.
    string encoding;
    string ontology;
    // See FIPA00025.
    string protocol;
    // To be unique.
    Ice::Identity conversationId;
  };

  struct Message {
    Envelope env;
    ACLPayload payload;
  };

  struct ApService {
    string name;
    string type;
    Ice::ObjectSeq addresses;
  };

  sequence<ApService> ApServiceSeq;

  struct ApDescription {
    string name;
    ApServiceSeq apServices;
  };

  struct ServiceDescription {
    string name;
    string type;
    Ice::StringSeq protocols;
    Ice::StringSeq ontologies;
    Ice::StringSeq languages;
    PropertyService::Properties properties;
  };

  sequence<ServiceDescription> ServiceDescriptionSeq;

  struct DfAgentDescription {
    Agent* name;
    ServiceDescriptionSeq services;
    Ice::StringSeq protocols;
    Ice::StringSeq ontologies;
  };  

};
